package com.googlecode.kipler.container.dl.creational;

import com.googlecode.kipler.container.dl.ABox;
import com.googlecode.kipler.container.dl.PBox;
import com.googlecode.kipler.container.dl.RBox;
import com.googlecode.kipler.container.dl.TBox;

/**
 * 
 * @author İnanç Seylan
 * 
 */
public abstract class BoxFactory {
	private boolean unfoldableTBox = true;

	public abstract ABox createABox();

	public abstract PBox createPBox();

	public abstract RBox createRBox();

	public abstract TBox createTBox();

	public boolean isUnfoldableTBox() {
		return unfoldableTBox;
	}

	public void setUnfoldableTBox(boolean unfoldableTBox) {
		this.unfoldableTBox = unfoldableTBox;
	}

	public static BoxFactory getFactory(ContainerType wcsType, boolean unfoldableTBox) {
		BoxFactory result = null;
		switch (wcsType) {
		case ALC:
			result = new ALCBoxFactory();
			break;
		case SHQ:
			result = new SHQBoxFactory();
			break;
		case SHIQ_BASIC:
			result = new SHIQBasicBoxFactory();
			break;
		case SHIQ_MODIFIED_INDIVIDUAL:
			result = new SHIQModifiedIndividualListBoxFactory();
			break;
		case SHOIQ_BASIC:
			result = new SHOIQBasicBoxFactory();
			break;
		case SHOIQ_MODIFIED_INDIVIDUAL:
			result = new SHOIQModifiedIndividualListBoxFactory();
			break;
		}
		result.setUnfoldableTBox(unfoldableTBox);
		return result;
	}
}
